<!DOCTYPE html>
<html>
<head>
	<title>segway discovery</title>
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<meta name="viewport" content="width=device-width,user-scalable=yes" />
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="<?= $domain['static'] ?>business/css/common.css">
	<link rel="stylesheet" type="text/css" href="<?= $domain['static'] ?>business/css/merchant_detail.css"></head>
<body>
	<?php
// 这里是包含子模板方法
$this->
	load->view('business/templates/header');
?>

<form id="form">
<input type="hidden" name="language" value="<?php echo $header['current_language']?>">
	

 
	<div class="merchant_detail">

	<div class="detail_title"><?php echo lang('merchant_words_images');?></div>



		


		<div class="detail_add_img">
		<input type="hidden" value="" name="images" class="detail_add_imginput" value="">
			<div class="detail_imgul">
						<?php 
					foreach ($content['merchant']['images'] as $key => $value) { ?>

					<li><img data-imgkey="" src="<?php echo $value;?>" alt=""><div class="detail_imguldel"><img src="<?= $domain['static'] ?>business/images/del.png" alt="" /></div></li>

					<?php } ?>
			</div>
			<div class="detail_sss">
				<div class="add_rou">
					
					<input name='file' type='file'  id="fileupload" />
				</div>
				<p><?php echo lang('merchant_field_image_tips');?></p>
			</div>
		</div>






	




		<div class="detail_title2"><?php echo lang('merchant_words_basic_information');?></div>
		<div class="detail_des">
<div class="detail_des_name">
	<p class="left_name">
			<?php echo lang('merchant_field_name');?>
		<span>*</span>
	</p>
	<input type="text" class="input name_input" name="name" placeholder="Enter tour name" value="<?php echo $content['merchant']['name'] ?>"></div>
<div class="detail_des_Location">
	<p class="left_name">
		<?php echo lang('merchant_field_location');?>
		<span>*</span>
	</p>
	<select class="input Country_input" name="country" data-Country="<?php echo $content['merchant']['country'] ?>" value="<?php echo $content['merchant']['country'] ?>">
		
	</select>
	<select class="input City_input" name="city" data-City="<?php echo $content['merchant']['city'] ?>" value="<?php echo $content['merchant']['city'] ?>" >
	</select>
	<input type="text" class="input address_input" name="address"  placeholder="Enter detail address" value="<?php echo $content['merchant']['address'] ?>"><img class="map_icon" src="<?= $domain['static'] ?>business/images/map.png"  alt="">
</div>

	


<div class="mapp"><div class="detail_des_map" id="map"></div>
	<div class="map_des"><?php echo lang('site_business_map_drag_to_mark_location');?></div></div>



 <input type="hidden" name="latitude" readonly id="lat">
 <input type="hidden" name="longitude" readonly id="lng">




<div class="Zipcode">
	<p class="lefts_name">
		<?php echo lang('merchant_field_zipcode');?>
		<span>*</span>
	</p>
	<input type="text" class="input" name="zipcode" placeholder="Enter number"  placeholder="Zip code" value="<?php echo $content['merchant']['zipcode'] ?>"></div>

	<div class="Telephone">
	<p class="lefts_name">
		<?php echo lang('merchant_field_mobile');?>
		<span>*</span>
	</p>
	<input type="text" class="input" name="mobile" placeholder="Enter number"  placeholder="Telephone" value="<?php echo $content['merchant']['mobile'] ?>"></div>


	<div class="Email">
	<p class="lefts_name">
		<?php echo lang('merchant_field_email');?>
		<span>*</span>
	</p>
	<input type="text" class="input" name="email" placeholder="Enter number"  placeholder="Email" value="<?php echo $content['merchant']['email'] ?>"></div>


<div class="Website">
	<p class="lefts_name">
		<?php echo lang('merchant_field_website');?>
		<span>*</span>
	</p>
	<input type="text" class="input" name="website" placeholder="Enter website"  placeholder="website" value="<?php echo $content['merchant']['website'] ?>">
</div>
	
	</div>





	<div class="detail_submit">
		<div class="submit_btn" id="submit_btn">Submit</div>
	</div>
</div>


</form>



<?php
// 这里是包含子模板方法
$this->
load->view('business/templates/footer');
?>

<script src="<?= $domain['static'] ?>business/js/jquery.min.js"></script>
<script src="<?= $domain['static'] ?>business/js/common.js"></script>
<script type="text/javascript" src="<?= $domain['static'] ?>business/js/ajaxfileupload.js"></script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=<?php echo $content['search']['google_ak'];?>&callback=initMap&language=<?php echo $content['search']['language'];?>"></script>

<script type="text/javascript" src="<?= $domain['static'] ?>business/js/merchant_detail.js"></script>

<!-- 
<script type="text/javascript">
	var marker;
	var image = '<?= $domain['static'] ?>business/images/map.png'
	function initMap() {
		var luxian = {
			lat:<?php echo (int)@$content['touroute']['latitude'];?>,
			lng:<?php echo (int)@$content['touroute']['longitude'];?>
		};
	     var map = new google.maps.Map(document.getElementById('map'), {
	       zoom: 4,
	       center: luxian
	     });
	     marker = new google.maps.Marker({
	   		draggable: true,
	     	animation: google.maps.Animation.DROP,
	        position: luxian,
	        map: map,
	         // icon: image,
	     });
	     map.addListener('click', function(e) {
	     	if ($('.gmnoprint').length<=1) {
	     		placeMarkerAndPanTo(e.latLng, map);
	     	}
	     })
	     google.maps.event.addListener(marker, 'position_changed', update);
	     update()
	}
	   function placeMarkerAndPanTo(latLng, map) {
	     marker = new google.maps.Marker({
	     	draggable: true,
	     	animation: google.maps.Animation.DROP,
	       position: latLng,
	       map: map
	     });
	     map.panTo(latLng);
	     if (marker.getAnimation() !== null) {
	        marker.setAnimation(null);
	      } else {
	        marker.setAnimation(google.maps.Animation.BOUNCE);
	      }
	   }
	   function update() {
	     var path = marker.getPosition();
	     $('#lat').val( path.lat().toString())
	     $('#lng').val( path.lng().toString())
	   }
</script> -->



<script type="text/javascript">
	var marker;
	var image = '<?= $domain['static'] ?>business/images/map.png'
	function initMap() {

		var luxian = {
			lat:<?php echo @$content['merchant']['latitude'] ?: 0; ?>,
			lng:<?php echo @$content['merchant']['longitude'] ?: 0;?>
		};
	     var map = new google.maps.Map(document.getElementById('map'), {
	       zoom: 4,
	       center: luxian
	     });
	     marker = new google.maps.Marker({
	   		draggable: true,
	     	animation: google.maps.Animation.DROP,
	        position: luxian,
	        // map: map,
	        icon: image,
	     });
	     var hasmarker = false; //没有标记

	     if (luxian.lat ==0 && luxian.lng == 0) {
	     	map.addListener('click', function(e) {

	     		if ( !hasmarker ) {

	     			placeMarkerAndPanTo(e.latLng, map);
	     			 hasmarker = true;
	     			  update()
	     		}
	     	})
	     }else{

	     	 marker.setMap(map)
	     	 hasmarker = true;
	     }
	  
	     google.maps.event.addListener(marker, 'position_changed', update);
	     update()
	}
	   function placeMarkerAndPanTo(latLng, map) {
	     marker = new google.maps.Marker({
	     	draggable: true,
	     	animation: google.maps.Animation.DROP,
	       position: latLng,
	       map: map,
	        icon: image,
	     });
	     map.panTo(latLng);
	     if (marker.getAnimation() !== null) {
	        marker.setAnimation(null);
	      } else {
	        marker.setAnimation(google.maps.Animation.BOUNCE);
	      }
	   }
	   function update() {
	     var path = marker.getPosition();
	     $('#lat').val( path.lat().toString())
	     $('#lng').val( path.lng().toString())
	   }
</script>

</body>
</html>